import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from "element-ui"
import 'element-ui/lib/theme-chalk/index.css';
Vue.config.productionTip = false
Vue.use(ElementUI);
// 引入样式文件 
import './styles/index.less';
import * as echarts from "echarts";
Vue.prototype.$echarts = echarts

Vue.filter("hanler", function(params) {
    let time;
    if (params.length > 10) { // 当时间戳为13位的时候
        time = new Date(params)
    } else {
        time = new Date(params * 1000) // 时间戳为10位的时候，先补充三位在进行转换
    }
    let year = time.getFullYear() + '-';
    let month = (time.getMonth() + 1 < 10 ? '0' + (time.getMonth() + 1) : time.getMonth() + 1) + '-';
    let day = (time.getDate() < 10 ? '0' + time.getDate() : time.getDate()) + ' ';
    let hour = (time.getHours() < 10 ? '0' + time.getHours() : time.getHours()) + ':';
    let minute = (time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes()) + ':';
    let second = time.getSeconds() < 10 ? '0' + time.getSeconds() : time.getSeconds();
    return year + month + day + hour + minute + second
})

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')